package 设计模式.状态设计模式;

public enum OrderStateEnum {
    UNPAY {
        public void nextState(Order order){
            order.setState(PAID);
        }
    },
    PAID{
        public void nextState(Order order){
            order.setState(WAITING);
        }
    },
    WAITING{
        public void nextState(Order order){
            order.setState(FINISH);
        }
    },
    FINISH{
        public void nextState(Order order){
            order.setState(FINISH);
        }
    };
    public abstract void nextState(Order order);
}
